//
//  MainViewController.h
//  memory
//
//  Created by Storm Christoph on 12/23/09.
//  Copyright __MyCompanyName__ 2009. All rights reserved.
//
#import <UIKit/UIKit.h>

#import "FlipsideViewController.h"
#import "Card.h"
#import "Card.h"
#import "MyPoint.h"
#import "GameController.h"
#import "AccelerometerFilter.h"

@class AccelerometerFilter;

//@protocol UIAccelerometerDelegate
//-(BOOL)cardShouldFlip:(Card *)card;
//-(void)cardFlipped:(Card *)card;
//@end

@interface MainViewController : UIViewController <UIAccelerometerDelegate, FlipsideViewControllerDelegate> {
	
	IBOutlet UIButton *firstButton;
	IBOutlet UILabel *labelRound;
	IBOutlet UIProgressView *timeBar;
	
	IBOutlet UIView *containerView;
	IBOutlet UIImageView *mainView;
	IBOutlet UIImageView *flipToView;
	
	//IBOutlet UIImageView *dragger;
	
	CGRect frame;
	
	AccelerometerFilter *filter;
	
}

@property (nonatomic, retain) UIView *containerView;
@property (nonatomic, retain) UIImageView *mainView;
@property (nonatomic, retain) UIImageView *flipToView;
@property (nonatomic, retain) UILabel *labelRound;
@property (nonatomic, retain) UIProgressView *timeBar;


- (Card*) createCardWithX:(int)xPos Y:(int)yPos Counter:(int)counterID Group:(int)groupID;
- (void) createCards;
- (void) calcCardSize;

- (void) calculatePositions:(int) nrOfCards;
- (void) onTimer;
- (void) onGameSolved:(int) seconds round:(int) roundNr;
- (void) onShake;
- (void) updateTimerBar:(CGFloat) progress;
- (void) startNewGame;

- (IBAction)showInfo;

@end
